class Alg<T extends Comparable<T>> {
    public T findMax (T[] array) {
        T max = array[0];
        for (int i = 1; i < array.length; i++) {
            if(max.compareTo(array[i]) < 0 ) {
                max = array[i];
            }
        }
        return max;
    }
}

public class Main1 {
    public static void main(String[] args) {
        Alg<Character> alg = new Alg<>();
        Character [] array = {'a','c','d','f'};
        Character ret = alg.findMax(array);
        System.out.println(ret);
    }
}
